import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;

public class GroupManager {
    private Map<String, List<String>> groups = new HashMap<>();

    public void addGroup(String groupName) {
        groups.put(groupName, new ArrayList<>());
    }

    public void addStudentToGroup(String groupName, String studentName) {
        groups.computeIfAbsent(groupName, k -> new ArrayList<>()).add(studentName);
    }

    public List<String> getGroupList() {
        return new ArrayList<>(groups.keySet());
    }

    public List<String> getStudentsInGroup(String groupName) {
        return groups.getOrDefault(groupName, new ArrayList<>());
    }
}
